<extend name="Base:base" />
<block name="head">
    <style>
        a{color:#fff;}
    </style>
</block>
<block name="content">
    <foreach name="nodes" item="app">
        <div class="span12">
            <div class="box paint color_2">
                <div class="title">
                    <div class="row-fluid">
                        <h4>{$app.title}
                            <small>{$app.remark}
                                [<a href="{:U('Admin/Rbac/addNode',array('pid'=>$app['id'],'level'=>2))}">添加控制器</a>]
                                [<a href="{:U('Admin/Rbac/editNode',array('id'=>$app['id']))}">修改</a>]
                                [<a href="{:U('Admin/Rbac/deleteNode',array('id'=>$app['id']))}">删除</a>]
                            </small>
                        </h4>
                    </div>
                </div>
                <!-- End .title -->
                <div class="content">
                    <div class="tabbable tabs-left">
                        <ul id="tabExample2" class="nav nav-tabs">
                            <foreach name="app.child" item="action" key='actionKey'>
                                <li <if condition="$actionKey eq 0">class="active"</if>>
                                <a href="#action{$action.id}" data-toggle="tab"><strong>{$action.title}</strong> (<small>{$action.remark}</small>)</a>
                                </li>
                            </foreach>
                        </ul>
                        <div class="tab-content">
                            <foreach name="app.child" item="action"  key='actionKey'>
                                <div class="tab-pane fade <if condition='$actionKey eq 0'> in active</if>" id="action{$action.id}">
                                    <p>
                                        [<a href="{:U('Admin/Rbac/addNode',array('pid'=>$action['id'],'level'=>3))}">添加方法</a>]
                                        [<a href="{:U('Admin/Rbac/editNode',array('id'=>$action['id'],'level'=>2))}">修改</a>]
                                        [<a href="{:U('Admin/Rbac/deleteNode',array('id'=>$action['id']))}">删除</a>]
                                    </p>
                                    <foreach name="action.child" item="method">
                                        <p>
                                            <span>{$method.title}</span>{$method.remark}
                                            [<a href="{:U('Admin/Rbac/editNode',array('id'=>$method['id'],'level'=>3))}">修改</a>]
                                            [<a href="{:U('Admin/Rbac/deleteNode',array('id'=>$method['id']))}">删除</a>]
                                        </p>
                                    </foreach>
                                </div>
                            </foreach>
                        </div>
                    </div>
                </div>
                <!-- End .content --> 
            </div>
            <!-- End  .box --> 
        </div>
    </foreach>

</block>
